package com.gxa.controller.wgl.customer;

import com.gxa.common.R;
import com.gxa.common.Status;
import com.gxa.service.CustomerReportService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@Api(value = "客服报表功能",tags = "客服报表功能API")
@RequiresRoles(value = {"超级管理员","院长","主任","秘书"},logical = Logical.OR)
@RequestMapping("/customer/report")
public class CustomerReportController {

    @Autowired
    CustomerReportService customerReportService;

    @RequestMapping(value = "/findReportList",method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation(value = "客服状态报表接口",notes = "客服状态报表接口",httpMethod = "GET")
    @ApiResponses({
            @ApiResponse(code = 200, message = "查询成功"),
            @ApiResponse(code = 400, message = "代表参数格式不对"),
            @ApiResponse(code = 404, message = "代表找不到此请求"),
            @ApiResponse(code = 500, message = "代表后端代码出现异常"),
    })
    /**
     * 查找患者报表信息
     */
    public R findReportList(){
        return customerReportService.getCustomerReportStatus();
    }

    @RequestMapping(value = "/findReportDate",method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation(value = "客服分布月份",notes = "客服月份分布接口",httpMethod = "GET")
    @ApiResponses({
            @ApiResponse(code = 200, message = "查询成功"),
            @ApiResponse(code = 400, message = "代表参数格式不对"),
            @ApiResponse(code = 404, message = "代表找不到此请求"),
            @ApiResponse(code = 500, message = "代表后端代码出现异常"),
    })
    public R findReportArea(){
       return customerReportService.getCustomerDate();
    }


    @RequestMapping(value = "/findReportType",method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation(value = "客服类型占比",notes = "客服类型数量占比",httpMethod = "GET")
    @ApiResponses({
            @ApiResponse(code = 200, message = "查询成功"),
            @ApiResponse(code = 400, message = "代表参数格式不对"),
            @ApiResponse(code = 404, message = "代表找不到此请求"),
            @ApiResponse(code = 500, message = "代表后端代码出现异常"),
    })
    public R findReportFollow(){
        return customerReportService.getCustomerReportType();
    }



    @RequestMapping(value = "/findYearReport",method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation(value = "客服年度报表",notes = "客服年度报表接口",httpMethod = "GET")
    @ApiResponses({
            @ApiResponse(code = 200, message = "查询成功"),
            @ApiResponse(code = 400, message = "代表参数格式不对"),
            @ApiResponse(code = 404, message = "代表找不到此请求"),
            @ApiResponse(code = 500, message = "代表后端代码出现异常"),
    })
    public R findYearReport(){
       return customerReportService.getYearReport();

    }


}